<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>插件</title>
</head>

<body>
    <div id="app1">
        <p v-my-directive="msg"></p>
    </div>
    <script src="https://cdn.bootcss.com/vue/2.5.16/vue.js"></script>
    <script src="./vue-myPlugin.js"></script>
    <script>
        //声明使用插件
        Vue.use(MyPlugin) //内部会执行MyPlugin.install(Vue)
        Vue.myGlobalMethod()
       const vm = new Vue({
            el: '#app1',
            data: {
                msg: 'atguigu'
            }
        })
        vm.$myMethod()
    </script>
</body>

</html>